import store from '@/store'

export function dictMap (type){
    return store.state.dictMap[type];
}

export function dictMapDefault(type){
    let dictMapElement = store.state.dictMap[type];
    for (let index in dictMapElement) {
        let item = dictMapElement[index];
        if (item.isDefault === "1") {
            return item.value
        }
    }
    return null;
}

export function dictMapDesc(type,value){
    let dictMapElement = store.state.dictMap[type];
    for (let index in dictMapElement) {
        let item = dictMapElement[index];
        if (item.value === value) {
            return item.desc
        }
    }
    return null;
}
